package com.yanqu.road.entity.activity.dunhuangshiku;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description 敦煌石窟玩家请求协助的记录
 * @Author cwq
 * @Data 2021/4/15 18:46
 */
@FieldTypeAnnotation(tableName = "t_c_dunhuangshiku_help_record_data")
public class DunHuangShiKuHelpRecordData extends DataObject {
    @FieldTypeAnnotation(update = true)
    private long id;
    @FieldTypeAnnotation(select = true)
    private long activityId;
    @FieldTypeAnnotation(select = true, desc = "分组ID")
    private int groupId;
    @FieldTypeAnnotation(desc = "求助玩家的id")
    private long userId;
    @FieldTypeAnnotation(desc = "事件id")
    private int eventId;
    @FieldTypeAnnotation(desc = "目标id/剩余血量 如果事件是玩家事件该值代表目标id，npc事件代表npc血量")
    private long targetId;
    @FieldTypeAnnotation(desc = "目标总血量")
    private long targetTotalBlood;
    @FieldTypeAnnotation(desc = "协助伤害信息集合,k:玩家id,v:攻击信息")
    private Map<Long, DunHuangShiKuAttackInfo> helpAttackMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "目标被击杀的玩家id。未被击杀为0,如果killedUserId=userId,说明有资格领取奖励， -1表示隔天过期了")
    private long killedUserId;
    @FieldTypeAnnotation(desc = "是否领取过奖励")
    private boolean isReceived;
    @FieldTypeAnnotation(desc = "可以领取的文书数量")
    private int bookNum;
    @FieldTypeAnnotation(desc = "可以领取的奖励")
    private String reward = "";
    @FieldTypeAnnotation(desc = "求助时间")
    private long recordTime;

    public DunHuangShiKuHelpRecordData() {
        this.setInsertOption();
    }

    public void setId(long id) {
        if (this.id != id) {
            this.id = id;
            setOp(DataStatus.Update);
        }

    }
    public void setActivityId(long activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }

    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }

    }
    public void setEventId(int eventId) {
        if (this.eventId != eventId) {
            this.eventId = eventId;
            setOp(DataStatus.Update);
        }

    }
    public void setTargetId(long targetId) {
        if (this.targetId != targetId) {
            this.targetId = targetId;
            setOp(DataStatus.Update);
        }

    }
    public void setTargetTotalBlood(long targetTotalBlood) {
        if (this.targetTotalBlood != targetTotalBlood) {
            this.targetTotalBlood = targetTotalBlood;
            setOp(DataStatus.Update);
        }

    }
    public void setKilledUserId(long killedUserId) {
        if (this.killedUserId != killedUserId) {
            this.killedUserId = killedUserId;
            setOp(DataStatus.Update);
        }

    }
    public void setIsReceived(boolean isReceived) {
        if (this.isReceived != isReceived) {
            this.isReceived = isReceived;
            setOp(DataStatus.Update);
        }

    }
    public void setBookNum(int bookNum) {
        if (this.bookNum != bookNum) {
            this.bookNum = bookNum;
            setOp(DataStatus.Update);
        }

    }
    public void setRecordTime(long recordTime) {
        if (this.recordTime != recordTime) {
            this.recordTime = recordTime;
            setOp(DataStatus.Update);
        }

    }

    public void setReward(String reward) {
        if(null == reward){
            return;
        }
        if(!this.reward.equals(reward)) {
            this.reward = reward;
            setOp(DataStatus.Update);
        }
    }

    public void setHelpAttackMap(Map<Long, DunHuangShiKuAttackInfo> helpAttackMap) {
        this.helpAttackMap = helpAttackMap;
    }

    public long getId() {
        return id;
    }

    public long getActivityId() {
        return activityId;
    }

    public int getGroupId() {
        return groupId;
    }

    public long getUserId() {
        return userId;
    }

    public int getEventId() {
        return eventId;
    }

    public long getTargetId() {
        return targetId;
    }

    public Map<Long, DunHuangShiKuAttackInfo> getHelpAttackMap() {
        return helpAttackMap;
    }

    public long getKilledUserId() {
        return killedUserId;
    }

    public boolean isReceived() {
        return isReceived;
    }

    public long getRecordTime() {
        return recordTime;
    }

    public long getTargetTotalBlood() {
        return targetTotalBlood;
    }

    public String getReward() {
        return reward;
    }

    public int getBookNum() {
        return bookNum;
    }
}
